home *** CD-ROM | disk | FTP | other *** search
- Path: druid.borland.com!usenet
- From: johnhuang@earthlink.net
- Newsgroups: comp.lang.c++
- Subject: Re: C++ beginner quesion on data member access.
- Date: Wed, 17 Apr 1996 18:24:45 GMT
- Organization: Borland Intl
- Message-ID: <4l3d5l$drc@druid.borland.com>
- References: <4kgb76$r3s@HOPPER.ACM.ORG> <316E7140.C5D@platinum.com> <00001a81+0000b22d@msn.com>
- NNTP-Posting-Host: jhuang.borland.com
- X-Newsreader: Forte Free Agent 1.0.82
-
- One more reason to always use data access functions:
-
- For example, you have a class A with a data member m, and at certain
- point in your program there is a bug which changed m to some
- un-reasonable value,
-
- If you have m as a private data member and use public access member
- functions, you can simply set a break point in SetM(...), it won't be
- hard to catch the bug. if you have m as a public data member, it won't
- be so easy.
-
- John
-
-